Delphi做的时钟很漂亮
【相关图片】
【源码结构】 with paintbox1.Canvas do
begin
pen.Width :=1;
pen.Color :=clRed;
moveto(trunc(paintbox1.Width/2) ,trunc(paintbox1.Height/2));
lineto(trunc(paintbox1.Width/2 x/1.4),trunc(paintbox1.Height/2-y/1.4));
pen.width:=2;
moveto(trunc(paintbox1.Width/2) ,trunc(paintbox1.Height/2));
lineto(trunc(paintbox1.Width/2-x/4),trunc(paintbox1.Height/2 y/4));
pen.Color :=clGreen;
moveto(trunc(paintbox1.Width/2),trunc(paintbox1.Height/2));
lineto(trunc(paintbox1.Width/2) trunc(x1/1.5),
trunc(paintbox1.Height/2)-trunc(y1/1.5));
pen.Width :=4;
pen.Color :=clBlack;
moveto(trunc(paintbox1.Width/2),trunc(paintbox1.Height/2));
lineto(trunc(paintbox1.Width/2) trunc(x2/2.1),
trunc(paintbox1.Height/2)-trunc(y2/2.1));
Font.Size:=20;
textout(trunc(paintbox1.Width/2)-10 ,trunc(paintbox1.Height/2)-140,'12');
textout(trunc(paintbox1.Width/2)-5 ,trunc(paintbox1.Height/2) 110,'6');
textout(trunc(paintbox1.Width/2) 160 ,trunc(paintbox1.Height/2)-15,'3');
textout(trunc(paintbox1.Width/2)-170 ,trunc(paintbox1.Height/2)-15,'9');
end;
评论